<?php



class RingtoneMapBuilder {

	
	const CLASS_NAME = 'lib.model.map.RingtoneMapBuilder';

	
	private $dbMap;

	
	public function isBuilt()
	{
		return ($this->dbMap !== null);
	}

	
	public function getDatabaseMap()
	{
		return $this->dbMap;
	}

	
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap('propel');

		$tMap = $this->dbMap->addTable('ringtone');
		$tMap->setPhpName('Ringtone');

		$tMap->setUseIdGenerator(true);

		$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addColumn('NAME', 'Name', 'string', CreoleTypes::VARCHAR, true, 255);

		$tMap->addColumn('AVATAR_PATH', 'AvatarPath', 'string', CreoleTypes::VARCHAR, false, 255);

		$tMap->addColumn('FILE_PATH_MP3', 'FilePathMp3', 'string', CreoleTypes::VARCHAR, true, 255);

		$tMap->addColumn('FILE_PATH_WAV', 'FilePathWav', 'string', CreoleTypes::VARCHAR, true, 255);

		$tMap->addColumn('DURATION', 'Duration', 'int', CreoleTypes::SMALLINT, false, null);

		$tMap->addForeignKey('CATEGORY_ID', 'CategoryId', 'int', CreoleTypes::INTEGER, 'ringtone_category', 'ID', false, null);

		$tMap->addForeignKey('CREATOR_ID', 'CreatorId', 'int', CreoleTypes::INTEGER, 'user', 'ID', true, null);

		$tMap->addColumn('CREATOR_NAME', 'CreatorName', 'string', CreoleTypes::VARCHAR, true, 255);

		$tMap->addColumn('CREATED_DATETIME', 'CreatedDatetime', 'int', CreoleTypes::TIMESTAMP, false, null);

		$tMap->addColumn('RT_STATUS', 'RtStatus', 'int', CreoleTypes::TINYINT, true, null);

		$tMap->addColumn('RBT_STATUS', 'RbtStatus', 'int', CreoleTypes::TINYINT, true, null);

		$tMap->addColumn('COMPOSER_ID', 'ComposerId', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('COMPOSER_NAME', 'ComposerName', 'string', CreoleTypes::VARCHAR, false, 255);

		$tMap->addColumn('COMPOSED_BY_USER', 'ComposedByUser', 'int', CreoleTypes::TINYINT, false, null);

		$tMap->addColumn('CHECKNUM', 'Checknum', 'string', CreoleTypes::VARCHAR, false, 30);

		$tMap->addColumn('TOTAL_SET', 'TotalSet', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('TOTAL_DOWNLOAD', 'TotalDownload', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('BONUS_SET', 'BonusSet', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('BONUS_DOWNLOAD', 'BonusDownload', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('UPDATE_TYPE', 'UpdateType', 'int', CreoleTypes::TINYINT, false, null);

		$tMap->addColumn('LAST_UPDATE_DATETIME', 'LastUpdateDatetime', 'int', CreoleTypes::TIMESTAMP, false, null);

	} 
} 